<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

<div id="root">
    <script>
        let date = new Date();
        document.write(
            "今天日期是：" +
            date.getFullYear() + "年" +
            (date.getMonth() + 1) + "月" +
            date.getDate() + "日 " +
            getDay(date.getDay()) +
            " 现在时间是：" +
            date.getHours() + "时" +
            date.getMinutes() + "分" +
            date.getSeconds() + "秒"
        )

        // 获取星期几（中文版）
        function getDay(day) {
            switch (day) {
                case 0:
                    return "星期日";
                case 1:
                    return "星期一";
                case 2:
                    return "星期二";
                case 3:
                    return "星期三";
                case 4:
                    return "星期四";
                case 5:
                    return "星期五";
                case 6:
                    return "星期六";
                default:
                    console.log(day);
                    return "???";
            }
        }
    </script>
</div>

</body>
</html>